<template>
    <div class="main">
        <div class="image_one card-item " v-for="item in AllList" :key="item.uid">
            <div class="sheet_top">
                <img :src="item.img" alt="">
                <div class="describe">{{ item.wenan }}</div>
            </div>
            <div class="sheet_button">
                <span class="iconfont icon-aixin"></span>
                <span class="iconfont icon-icon_favorite"></span>
                <span class="iconfont icon-fenxiang"></span>
            </div>
        </div>
    </div>

</template>

<script setup>
import { ref, onMounted } from 'vue';
import { getSheetList } from '@/api/api'
const AllList = ref([])

const initGetList = async () => {
    let { data } = await getSheetList()
    AllList.value = data
}
onMounted(() => {
    initGetList()
})
</script>

<style lang="scss" scoped>
.main {
    width: 100%;
    color: rgba(80, 80, 80, 1);
    background-color: rgba(243, 243, 243, 1);
    text-align: center;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;

    .image_one:first-child {
        height: 420px;

        img {
            width: 100%;
            height: 326px;
            object-fit: cover;
        }
    }

    .image_one {
        width: 49%;
        height: 320px;
        background-color: #fff;
        margin-bottom: 20px;
        border-radius: 15px;
        overflow: hidden;


        .sheet_top {
            position: relative;

            .describe {
                width: 277px;
                height: 57px;
                line-height: 57px;
                position: absolute;
                left: 0;
                bottom: 12px;
                font-size: 22px;
                color: #fff;
                text-align: left;
                padding-left: 20px;
                overflow: hidden;
            }
        }

        img {
            width: 100%;
            height: 240px;
            object-fit: cover;
        }
    }

    .sheet_button {
        span {
            width: 48px;
            height: 48px;
            padding: 20px;
            font-size: 48px;
        }
    }
}


.main {
    column-count: 2; // 定义三列
    column-gap: 10px; // 列与列的距离为20px

    .card-item {
        width: 98%;                            
        grid-row-start: auto;
        break-inside: avoid; // 不被截断
    }
}
</style>